package cn.onein.edu.manage.domain;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="learn_section")
public class LearnSection {
	
	private Long id;
	
	private String name;
	
	private String title;
	
	private Set<LearnCategory> categorys = new HashSet<LearnCategory>();

	@Id
	@Column(name="ID")
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@Column(name="NAME")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name="TITLE")
	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@OneToMany(mappedBy = "section", cascade = CascadeType.ALL)
	public Set<LearnCategory> getCategorys() {
		return categorys;
	}

	public void setCategorys(Set<LearnCategory> categorys) {
		this.categorys = categorys;
	}
	
	

}
